<?php

namespace process;


use app\crontab\Factory;
use app\crontab\Wish;
use GatewayWorker\Lib\Gateway;
use Workerman\Crontab\Crontab;

class Task
{
    public function onWorkerStart()
    {

        // 每分钟执行一次
        new Crontab('* * * * *', function(){
            //var_dump('计时器');
            //建造工厂
            (new Factory())->building();
            //刷新心愿
            (new Wish())->refresh();

        });

        // 每秒钟执行一次
        new Crontab('* * * * * *', function(){
            //生产队列
            (new Factory())->production();

        });




    }

}